#pragma once
#include<vector>

namespace zkz {

	template<size_t N>
	class bitset {
	public:
		bitset()
		{
			_bits.resize(N / 32 + 1);
		}
		void set(size_t pos) {
			size_t i = pos / 32;
			size_t j = pos % 32;

			_bits[i] |= (1 << j);
		}
		void reset(size_t pos) {
			size_t i = pos / 32;
			size_t j = pos % 32;

			_bits[i] &= (~(1 << j));
		}
		bool test(size_t pos) {
			size_t i = pos / 32;
			size_t j = pos % 32;

			return (_bits[i] >> j) & 1;
		}
	private:
		std::vector<int> _bits;
	};
};